package ru.sstu.renju.swing;

import java.awt.FlowLayout;

import javax.swing.JFrame;

import ru.sstu.renju.config.Config;
import ru.sstu.renju.config.ConfigReader;
import ru.sstu.renju.config.Platform;
import ru.sstu.renju.swing.renderers.SwingRenderer;

/**
 * <code>Main</code> class is main application class.
 *
 * @author denis_murashev
 * @since Renju 1.0
 */
public final class Main {

	private Main() {
	}

	/**
	 * @param args arguments
	 */
	public static void main(String[] args) {
		Platform platform = new Platform(SwingRenderer.class);
		Config config = new ConfigReader().getConfig(platform);
		JFrame frame = new JFrame(config.getBundle().getString("app.title"));
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setLayout(new FlowLayout());
		GamePanel panel = new GamePanel(config);
		frame.add(panel);
		frame.add(new ConfigPanel(config, panel));
		frame.pack();
		frame.setLocationRelativeTo(frame.getRootPane());
		frame.setVisible(true);
	}
}
